<?php
namespace app\common\model;
use app\common\model\CommonModel;
use think\Db;

class OrderGoods extends CommonModel
{
	/**
	* 添加订单商品信息
	*/
	public function serOrderGoods($data)
	{
		return $this->insert($data);
	}
    /**
    * 获取商品信息列表
    */
    public function orderGoodsList($where,$limit = 0)
    {
        $og = $this->where($where);
        if($limit != 0)
        {
            $og->limit($limit);
        }
        $item = $og->select();
        return empty($item) ? array():$item->toArray();
    }
    /**
    * 获取一条数据
    */
    public function orderGoodsInfo($where,$field)
    {
        $item = $this->where($where)->field($field)->find();
        return empty($item) ? array():$item->toArray();
    }
    /**
    * 修改订单商品信息
    */
	public function updateOrderGoods($where,$data)
	{
		return $this->where($where)->update($data);
	}
}
